package cs301.msflags;

import cs301.game.GameConfig;
import cs301.game.GameMainActivity;
import cs301.game.LocalGame;
import cs301.game.ProxyGame;
import cs301.game.ProxyPlayer;
import cs301.game.GamePlayerType;

/**
 * @author John Olennikov
 * @author Kyanne Mayfield
 * @author Allie Seibert
 * @author Emilia Holbik
 * @version 12/7/2012
 * 
 *            This class creates a game and adds information to the initial 
 *            player configuration GUI.
 */

public class MSFlagsMainActivity extends GameMainActivity {
	
	/**
	 * Whether or not to show the board configuration GUI
	 */
	
	public static boolean showConfig = true;
	
	/**
	 * Whether or not the toggle button for uncover mode is toggled
	 */
	
	public static boolean uncoverMode = false;
	
	
	/**
	 * This method defines the allowed player types, creates a game
	 * configuration class for Minesweeper Flags, and adds default players.
	 */

	@Override
	public GameConfig createDefaultConfig() {
		// Define the allowed player types
		GamePlayerType[] playerTypes = new GamePlayerType[3];
		playerTypes[0] = new GamePlayerType("Local Human Player", false,
				"cs301.msflags.MSFlagsHumanPlayer");
		playerTypes[1] = new GamePlayerType("Simple AI Player", false,
				"cs301.msflags.MSFlagsSimpleComputerPlayer");
		playerTypes[2] = new GamePlayerType("Smart AI Player", false,
				"cs301.msflags.MSFlagsAdvancedComputerPlayer");
		// Create a game configuration class for Counter
		GameConfig defaultConfig = new GameConfig(playerTypes, 2, 2,
				"Minesweeper Flags Game");

		// Add the default players
		defaultConfig.addPlayer("Human", 0);
		defaultConfig.addPlayer("Computer", 1);

		// done!
		return defaultConfig;
	}

	@Override
	public LocalGame createLocalGame(GameConfig config) {
		// Ensures the setup screen will show up
		this.showConfig = true;
		
		// Set the first player as player 1
		return new MSFlagsGame(config,0);
	}

	@Override
	public ProxyPlayer createRemotePlayer() {
		// %%%TODO update code
		return null;
	}

	@Override
	public ProxyGame createRemoteGame(String hostName) {
		// %%%TODO update code
		return null;
	}

}
